﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;

namespace WindowsFormsApp4
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }
        public static Dictionary<string, string> users = new Dictionary<string, string>();




        /// <summary>
        /// 登录
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            string uid = textBox1.Text;
            string pwd = textBox2.Text;

            var usr = users.Where(x => x.Key == uid && x.Value == pwd).FirstOrDefault();
        

           

            


            if (usr.Key!=null && usr.Value!=null)
            {

                Form4 form4 = new Form4();
                form4.Show();
                MessageBox.Show("登陆成功！");
            }
            else
            {
                MessageBox.Show("登录失败！");
            }

           


        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void Form1_Load(object sender, EventArgs e)
        {
            users.Add("yun","yun0823");
        }
        //注册
        private void button2_Click(object sender, EventArgs e)
        {
            Form3 form3 = new Form3();
            form3.Show();
            

        }
    }
}
